//
//  FileCell.m
//  WOPrototype
//
//  Created by Olof Millberg on 2010-05-04.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "FileCell.h"


@implementation FileCell

@synthesize fileNameLabel;
@synthesize sizeLabel;
@synthesize dateLabel; 
@synthesize iconImageView; 
@synthesize file;
@synthesize background;

- (void) setFile:(WOFile *)aFile
{
	[file release];
	file = [aFile retain];
	
	fileNameLabel.text = file.fileName;
	sizeLabel.text = @"";
	dateLabel.text = @"";
	iconImageView.image = file.fileIcon;
}

- (void) setSelected:(BOOL)isSelected animated:(BOOL)animated
{
	//	if (animated)
	//	{
	//		[UIView beginAnimations:nil context:nil];
	//		[UIView setAnimationDuration:0.4];
	//	}
	
	[super setSelected:isSelected animated:animated];
	if (isSelected)
		background.image = [UIImage imageNamed:@"cell_selected.png"];
	else
		background.image = [UIImage imageNamed:@"cell_neutral.png"];
	
	//	if (animated)
	//		[UIView commitAnimations];
}

@end
